eln_cmass_sv_up1 = eln_cmass_sv,
reb_cdv_up1 = reb_cdv,
reb_cdv_sv_up1 = reb_cdv_sv,
farc_cdv_up1 = farc_cdv,
farc_cdv_sv_up1 = farc_cdv_sv,
eln_cdv_up1 = eln_cdv,
eln_cdv_sv_up1 = eln_cdv_sv)
m_data_f <- m_data_f %>%
mutate_at(vars(reb_ckill_up1:eln_cdv_sv_up1)
, ~replace_na(., 0))
m_data_f <- m_data_f %>%
mutate(dv4b.1.1.reb_ckill_up1_r = (reb_ckill_up1/updated_pop)*100000,
dv4b.2.1.farc_ckill_up1_r = (farc_ckill_up1/updated_pop)*100000,
dv4b.3.1.eln_ckill_up1_r = (eln_ckill_up1/updated_pop)*100000
)
dat_weint <- read_csv("weintraubreplication.csv")
View(dat_weint)
dat_weint <- dat_weint %>%
dplyr::select(divipola, year,
kciv_FARC, attacks_FARC, indiscrim_FARC)
m_data_f2 <- left_join(m_data_f, dat_weint)
View(m_data_f2)
m_data_f <- m_data_f %>%
mutate(dv2.1.kciv_FARC_r = (kciv_FARC/updated_pop)*100000)
m_data_f <- left_join(m_data_f, dat_weint)
m_data_f <- m_data_f %>%
mutate(dv2.1.kciv_FARC_r = (kciv_FARC/updated_pop)*100000)
m_data_f <- m_data_f %>%
mutate_at(vars(p_strat:v_strat2, cr, cr2)
, ~replace_na(., 0))
m_data_f <- m_data_f %>%
rename(iv2.p_strat = p_strat,
iv3.s_strat = s_strat,
iv4.v_strat = v_strat,
iv4b.v_strat = v_strat2,
iv1.1.cr = cr,
iv1.2.cr = cr2)
m_data_f <- m_data_f %>% ## Creating dummy variables as IVs. Based on type of strategy.
mutate(
cv8.2.no_p_str = case_when(
iv2.p_strat == 0 & iv1.2.cr == 1 ~ 1,
TRUE ~ 0),
cv8.3.no_s_str = case_when(
iv3.s_strat == 0 & iv1.2.cr == 1 ~ 1,
TRUE ~ 0),
cv8.4a.no_v_str = case_when(
iv4.v_strat == 0 & iv1.1.cr == 1 ~ 1,
TRUE ~ 0),
cv8.4b.no_v_str = case_when(
iv4b.v_strat == 0 & iv1.2.cr == 1 ~ 1,
TRUE ~ 0))
m_data_f <- m_data_f %>%
filter(updated_pop != 0)
m_data_f2 <- m_data_f %>%
dplyr::select(year, # Time ID
divipola, # Unit ID
dv4b.2.1.farc_ckill_up1_r, # Outcome V: FARC (OMC - Updated)
dv4b.3.1.eln_ckill_up1_r, # Outcome V: ELN (OMC - Updated)
dv2.1.kciv_FARC_r, # Outcome V: FARC (HROD-Presidency of Colombia)
iv2.p_strat, # Treatment 1: Protests
iv3.s_strat, # Treatment 2: Sanctuary
iv4b.v_strat, # Treatment 3: Violent self-protection
cv1.lpop, # Control V1: Population
cv2.rur_p, # Control V2: Rurality
cv3c.c_lsh1, # Control V3c1: Shared votes for the Left at Councils - Manual
cv4.nbi, # Control V4: Unsatisfied Basic Needs
cv5c.1.bd_o, # Control V5: OMC (Updated) - Balance of military dispute
cv6b.1.ce_o_r, # Control V6: OMC (Updated) - Rates of conflict events.
cv7b.3.pgf_cd_o_r, #Control V7: OMC (Updated) Rates of civilians killed by PGF
cv8.2.no_p_str, # Control V8: Other strategies but protest
cv8.4b.no_v_str, # Control V9: Other strategies but violent self-protection
cv8.3.no_s_str, # Control V10: Other strategies but sanctuary
median_c_lsh_m, # Median Vote for the Left at Councils - Manual
reb_ru # Rebel recruitment (raw number)
)
View(m_data_f2)
save.dta13(m_data_f2, file="Ortega(2024)-DataAnalysis_Updated(09282024).dta")
write_xlsx(m_data_f, "Ortega(2024)-AllVariables_Updated(09282024).xlsx")
data_alt <- read.dta13("~/Library/Mobile Documents/com~apple~CloudDocs/Documents/Sam Houston State University/1.ResearchAgenda&Pipeline/Project1/Replication/1.MainAnalysis/Ortega(2024)-DataAnalysis_Updated.dta")
data_alt <- data_alt %>%
dplyr::select(year, # Time ID
divipola, # Unit ID
dv4b.2.1.farc_ckill_up1_r, # Outcome V: FARC (OMC - Updated)
dv4b.3.1.eln_ckill_up1_r, # Outcome V: ELN (OMC - Updated)
dv2.1.kciv_FARC_r, # Outcome V: FARC (HROD-Presidency of Colombia)
iv2.p_strat, # Treatment 1: Protests
iv3.s_strat, # Treatment 2: Sanctuary
iv4b.v_strat, # Treatment 3: Violent self-protection
cv1.lpop, # Control V1: Population
cv2.rur_p, # Control V2: Rurality
cv3c.c_lsh1, # Control V3c1: Shared votes for the Left at Councils - Manual
cv4.nbi, # Control V4: Unsatisfied Basic Needs
cv5c.1.bd_o, # Control V5: OMC (Updated) - Balance of military dispute
cv6b.1.ce_o_r, # Control V6: OMC (Updated) - Rates of conflict events.
cv7b.3.pgf_cd_o_r, #Control V7: OMC (Updated) Rates of civilians killed by PGF
cv8.2.no_p_str, # Control V8: Other strategies but protest
cv8.4b.no_v_str, # Control V9: Other strategies but violent self-protection
cv8.3.no_s_str, # Control V10: Other strategies but sanctuary
median_c_lsh_m, # Median Vote for the Left at Councils - Manual
reb_ru # Rebel recruitment (raw number)
)
data_alt <- data_alt %>%
dplyr::select(year, # Time ID
divipola, # Unit ID
dv4b.2.1.farc_ckill_up1_r, # Outcome V: FARC (OMC - Updated)
dv4b.3.1.eln_ckill_up1_r, # Outcome V: ELN (OMC - Updated)
iv2.p_strat, # Treatment 1: Protests
iv3.s_strat, # Treatment 2: Sanctuary
iv4b.v_strat, # Treatment 3: Violent self-protection
cv1.lpop, # Control V1: Population
cv2.rur_p, # Control V2: Rurality
cv3c.c_lsh1, # Control V3c1: Shared votes for the Left at Councils - Manual
cv4.nbi, # Control V4: Unsatisfied Basic Needs
cv5c.1.bd_o, # Control V5: OMC (Updated) - Balance of military dispute
cv6b.1.ce_o_r, # Control V6: OMC (Updated) - Rates of conflict events.
cv7b.3.pgf_cd_o_r, #Control V7: OMC (Updated) Rates of civilians killed by PGF
cv8.2.no_p_str, # Control V8: Other strategies but protest
cv8.4b.no_v_str, # Control V9: Other strategies but violent self-protection
cv8.3.no_s_str, # Control V10: Other strategies but sanctuary
median_c_lsh_m, # Median Vote for the Left at Councils - Manual
reb_ru # Rebel recruitment (raw number)
)
m_data_f3 <- m_data_f2 %>%
select(-dv2.1.kciv_FARC_r)
all.equal(m_data_f3, data_alt)
View(data_alt)
View(m_data_f3)
library(tidyverse)
library(readstata13)
library(foreign)
library(readxl)
library(writexl)
rcs_data <- read_xlsx("TSCS-Colombia(1964-2005).xlsx") ### -> This is the template.
dane_8594 <- read_xlsx("DANE-PopulationMunicipality_AreaSexAge(1985-1994).xlsx")
dane_8594 <- dane_8594 %>%
select(DP:"ÁREA GEOGRÁFICA", "Total General")
dane_8594 <- dane_8594 %>%
rename(divipola = DPMP,
year = AÑO,
area = "ÁREA GEOGRÁFICA",
total = "Total General")
dane_8594$divipola <- as.numeric(dane_8594$divipola) # Transform a numeric into a character
dane_8594r <- dane_8594 %>%
filter(area == "Centros Poblados y Rural Disperso")
dane_8594r <- dane_8594r %>%
rename(rural = total) %>%
select(divipola, year, rural)
dane_8594t <- dane_8594 %>%
filter(area == "Total")
dane_8594t <- dane_8594t %>%
select(divipola, year, total)
dane_8594f <- left_join(dane_8594t, dane_8594r)
dane_8594f <- dane_8594f %>%
mutate(rurality = rural/total)
dane_9404 <- read_xlsx("DANE-PopulationMunicipality_AreaSexAge(1995-2004).xlsx")
dane_9404 <- dane_9404 %>%
select(DP:"ÁREA GEOGRÁFICA", "Total General")
dane_9404 <- dane_9404 %>%
rename(divipola = DPMP,
year = AÑO,
area = "ÁREA GEOGRÁFICA",
total = "Total General")
dane_9404$divipola <- as.numeric(dane_9404$divipola) # Transform a numeric into a character
dane_9404r <- dane_9404 %>%
filter(area == "Centros Poblados y Rural Disperso")
dane_9404r <- dane_9404r %>%
rename(rural = total) %>%
select(divipola, year, rural)
dane_9404t <- dane_9404 %>%
filter(area == "Total")
dane_9404t <- dane_9404t %>%
select(divipola, year, total)
dane_9404f <- left_join(dane_9404t, dane_9404r)
dane_9404f <- dane_9404f %>%
mutate(rurality = rural/total)
rm(dane_9404, dane_9404r, dane_9404t)
dane_05 <- read_xlsx("DANE-PopulationMunicipality_AreaSexAge(2005-2017).xlsx")
dane_05 <- dane_05 %>%
select(DP:"ÁREA GEOGRÁFICA", "Total General")
dane_05 <- dane_05 %>%
rename(divipola = DPMP,
year = AÑO,
area = "ÁREA GEOGRÁFICA",
total = "Total General")
dane_05 <- dane_05 %>%
filter(year == 2005)
dane_05$divipola <- as.numeric(dane_05$divipola) # Transform a numeric into a character
dane_05r <- dane_05 %>%
filter(area == "Centros Poblados y Rural Disperso")
dane_05r <- dane_05r %>%
rename(rural = total) %>%
select(divipola, year, rural)
dane_05t <- dane_05 %>%
filter(area == "Total")
dane_05t <- dane_05t %>%
select(divipola, year, total)
dane_05f <- left_join(dane_05t, dane_05r)
dane_05f <- dane_05f %>%
mutate(rurality = rural/total)
rm(dane_05, dane_05r, dane_05t)
dane_8505 <- bind_rows(dane_8594f, dane_9404f, dane_05f)
write_xlsx(dane_8505, "Ortega(2024)-DANE-Population(Total&Rural)_19852005.xlsx") # You can omit this step.
check <- read_xlsx("/Volumes/Backup Plus/Storage-OrganizedFiles/Article1-ReplicationMaterials/5.Data/CV/Ortega(2024)-DANE-Population(Total&Rural)_19852005.xlsx")
all.equal(dane_8505, check)
pop <- dane_8505 %>%
rename(updated_pop = total)
View(pop)
cv <- left_join(rcs_data, pop)
cv <- cv %>%
mutate(lpop = log(updated_pop)) %>%
relocate(divipola, year, lpop, rurality)
left <- read_xlsx("Ortega(2024)-ElectionsCouncils&LeftRepresentation(1984-2003).xlsx")
col_tscs <- read.dta13("CEDE-TSCS_Colombia(1958-2010)-V(12072021).dta")
col_tscs <- col_tscs %>%
filter(year > 1983 & year < 2006) %>%
rename(divipola = codmpio) %>%
dplyr::select(year, divipola)
View(cv)
left2 <- left_join(col_tscs, left)
left2 <- left2 %>%
mutate(c_lsh_m = (t_left_m/total_v)*100,
c_lsh_c = (t_left_core/total_v)*100,
c_lsh_b = (t_left_broad/total_v)*100,
c_lsh_e = (t_left_extended/total_v)*100)
left2 <- left2 %>%
dplyr::group_by(year) %>%
mutate(median_c_lsh_m = median(c_lsh_m, na.rm = T),
median_c_lsh_c = median(c_lsh_c, na.rm = T),
median_c_lsh_b = median(c_lsh_b, na.rm = T),
median_c_lsh_e = median(c_lsh_e, na.rm = T),) %>%
dplyr::ungroup()
View(left2)
left2 <- left2 %>%
dplyr::group_by(divipola) %>%
fill(total_v, t_left_m, t_left_core, t_left_broad, t_left_extended,
c_lsh_m, c_lsh_c, c_lsh_b, c_lsh_e,
median_c_lsh_m, median_c_lsh_c, median_c_lsh_b, median_c_lsh_e,
.direction = "down") %>%
dplyr::ungroup()
left2 <- left2 %>%
drop_na(total_v)
left2 <- left2 %>%
rename(cv3c.c_lsh1 = c_lsh_m, # Manual
cv3c.c_lsh2 = c_lsh_c, # Core
cv3c.c_lsh3 = c_lsh_b, # Broad
cv3c.c_lsh4 = c_lsh_e # Extended
)
left2 <- left2 %>%
dplyr::select(year, divipola, cv3c.c_lsh1:median_c_lsh_e)
View(left2)
cv <- left_join(cv, left2)
View(cv)
st_capac <- read.dta13("CEDE_CaracteristicasGenerales.dta")
View(st_capac)
st_capac$year <- year(st_capac$ano)
st_capac <- st_capac %>%
rename(divipola = codmpio) %>%
filter(year < 2006) %>%
dplyr::select(divipola, year, nbi)
st_capac <- st_capac %>%
dplyr::group_by(divipola) %>%
fill(nbi,
.direction = "downup") %>%
dplyr::ungroup()
census_v85 <- read.dta13("VIVIENDAS.dta")
## Componente: Vivienda Inadecuada
census_v85 <- census_v85 %>%
mutate(
nbi1.1 = case_when( # Tipo de vivienda
V11_TIPV == "Vivienda movil" | V11_TIPV == "Vivienda no habitable" ~ 1,
TRUE ~ 0),
nbi1.2 = case_when( # Tipo de paredes
V13_MATP == "Sin paredes" | V13_MATP == "Tela o desecho" ~ 1,
TRUE ~ 0),
nbi1.3 = case_when( # Tipo de piso
V14_MATP == "Tierra" ~ 1,
TRUE ~ 0)) %>%
relocate(I01_DPTO, I03_MPIO, I05_SECT, nbi1.1:nbi1.3)
census_v85 <- census_v85 %>%
mutate(
nbi2.1 = if_else(V18_SERS == "No Tiene", 1, 0),
nbi2.2 = case_when(
V17_ACUE == 4 &
(V24_AGUA == "Quebrada" | V24_AGUA == "Carro tanque"
| V24_AGUA == "Agua lluvia") ~ 1,
TRUE ~ 0)) %>%
relocate(I01_DPTO:nbi1.3, nbi2.1, nbi2.2)
census_v85 <- census_v85 %>%
mutate(hac = V25_TOPP/V15_NROC,
nbi3.1 = if_else(hac > 3, 1, 0)) %>%
relocate(I01_DPTO:nbi2.2, nbi3.1)
census_v85 <- census_v85 %>%
rowwise() %>%
mutate(total = sum(c_across(nbi1.1:nbi3.1), na.rm = T))
View(census_v85)
census_v85 <- census_v85 %>%
mutate(nbi = if_else(total > 0, 1, 0))
dat_cv3 <- census_v85 %>%
group_by(I01_DPTO, I03_MPIO) %>%
summarise(pop_c = n())
x1 <- census_v85 %>%
filter(nbi == 1) %>%
group_by(I01_DPTO, I03_MPIO) %>%
summarise(nbi_pop = n())
View(dat_cv3)
View(x1)
dat_nbi <- left_join(dat_cv3, x1, by=c("I01_DPTO", "I03_MPIO"))
dat_nbi <- dat_nbi %>% replace(is.na(.), 0)
dat_nbi <- dat_nbi %>%
mutate(nbi = (nbi_pop/pop_c)*100)
summary(dat_nbi$nbi)
cede <- read.dta13("CEDE-TSCS_Colombia(1958-2010)-V(12072021).dta")
cede <- cede %>%
filter(year == 1985)
cede$divipola_ch <- as.character(cede$codmpio)
cede$codmpio_ch = str_sub(cede$divipola_ch, - 3, - 1)
cede$I03_MPIO <- as.numeric(cede$codmpio_ch)
cede <- cede %>%
rename(I01_DPTO = coddepto)
dat_nbi <- left_join(dat_nbi, cede, by=c("I01_DPTO", "I03_MPIO"))
dat_nbi_f <- dat_nbi %>%
select(codmpio, municipio, nbi_pop, nbi) %>%
rename(divipola = codmpio)
dat_nbi_f <- dat_nbi_f %>%
drop_na(divipola) %>%
select(-I01_DPTO)
write_xlsx(dat_nbi_f, "Ortega(2024)-DANE-Census1985_NBI(06202022).xlsx")
rm(check)
check <- read_xlsx("/Volumes/Backup Plus/Storage-OrganizedFiles/Article1-ReplicationMaterials/5.Data/CV/Ortega(2024)-DANE-Census1985_NBI(06202022).xlsx")
all.equal(dat_nbi_f, check)
View(dat_nbi_f)
View(check)
rm(check)
NBI <- dat_nbi_f %>%
mutate(year = 1985) %>%
select(divipola, year, nbi)
View(NBI)
st_capac_f <- bind_rows(NBI, st_capac)
View(st_capac_f)
View(st_capac)
View(NBI)
NBI <- NBI %>%
select(-I01_DPTO)
st_capac_f <- st_capac_f %>%
select(-I01_DPTO)
cv <- left_join(cv, st_capac_f)
cv <- cv %>%
dplyr::group_by(divipola) %>%
fill(nbi,
.direction = "down") %>%
dplyr::ungroup()
cv <- cv %>%
select(divipola:cv3c.c_lsh4, nbi, median_c_lsh_m:median_c_lsh_e)
View(cv)
cv <- cv %>%
rename(cv1.lpop = lpop, # Logged Population
cv2.rur_p = rurality, # Percentage Rurality
cv4.nbi = nbi) # NBI
write_xlsx(cv, "Ortega(2022)-CV_ToComplete(06202022).xlsx")
check <- read_xlsx("/Volumes/Backup Plus/Storage-OrganizedFiles/Article1-ReplicationMaterials/5.Data/CV/Ortega(2022)-CV_ToComplete(06202022).xlsx")
View(check)
cv2 <- cv %>%
select(divipola, year, lpop, rurality, p_l_votes, nbi)
check <- check %>%
rename(cv1.lpop = lpop, # Logged Population
cv2.rur_p = rurality, # Percentage Rurality
cv4.nbi = nbi) #
View(check)
check <- check %>%
select(-p_l_votes)
View(check)
cv2 <- cv %>%
select(divipola, year, cv1.lpop, cv2.rur_p, cv4.nbi)
all.equal(check, cv2)
check <- check %>%
select(-p_l_votes) %>%
filter(year > 1984 | year < 2006)
check <- check %>%
filter(year > 1984 | year < 2006)
cv2 <- cv2 %>%
filter(year > 1984 | year < 2006)
all.equal(check, cv2)
check <- check %>%
filter(year > 1984 & year < 2006)
cv2 <- cv2 %>%
filter(year > 1984 & year < 2006)
all.equal(check, cv2)
View(cv2)
cv2 <- cv %>%
select(divipola, year, updated_pop)
mil <- read_csv("Ortega(2024)-OMC-TSCS_CasosFinal-Updated(09142024).csv")
mil <- mil %>%
rename(divipola = divipola_alt)
View(mil)
mil$divipola <- as.numeric(mil$divipola) # Transform a numeric into a character
mil2 <- left_join(cv2, mil, by=c("divipola", "year"))
mil2 <- mil2 %>%
mutate_at(vars(conf_events:cl_rg_pm_2b)
, ~replace_na(., 0))
mil2 <- mil2 %>%
group_by(divipola, year) %>%
mutate(t_sf_ua_up1 = sf_air_attacks + sf_mil_operations +
sf_ambushes + sf_hitnruns + sf_raids,
t_pm_ua_up1 = pm_tatt_mil_targets + pm_ambushes + pm_hitnruns +
pm_raids,
t_rg_ua_up1 =  rg_tatt_mil_targets + rg_ambushes + rg_hitnruns
+ rg_raids,
bd_st_rg_omc_up1.2 = ((cl_st_rg_2 + t_sf_ua_up1)/(cl_st_rg_2 + t_sf_ua_up1 + t_rg_ua_up1))) %>% # I
dplyr::select(divipola, year, bd_st_rg_omc_up1.2,
t_sf_ua_up1, t_pm_ua_up1, t_rg_ua_up1,
conf_events, sf_assassinations, pm_assassinations, sf_massacres, pm_massacres)
mil2 <- mil2 %>%
rename(
conf_events_up1 = conf_events,
sf_assassinations_up1 = sf_assassinations,
pm_assassinations_up1 = pm_assassinations,
sf_massacres_up1 = sf_massacres,
pm_massacres_up1 = pm_massacres)
View(mil2)
mil_cv <- left_join(cv2, mil2)
View(mil_cv)
View(mil2)
# CV6.1a - OMC Total Conflict Events
mil_cv <- mil_cv %>%
mutate(conf_events_omc_r_up1 = (conf_events_up1/updated_pop)*100000)
# CV7.1a - OMC Civilian Deaths by PGF
mil_cv <- mil_cv %>%
mutate(pgf_ckill_up1 = sf_assassinations_up1 + pm_assassinations_up1,
pgf_cmass_up1 = sf_massacres_up1 + pm_massacres_up1,
pgf_dv_up1 = pgf_ckill_up1 + pgf_cmass_up1,
pgf_ckill_omc_r_up1 =  (pgf_ckill_up1/updated_pop)*100000,
pgf_cmass_omc_r_up1 =  (pgf_cmass_up1/updated_pop)*100000,
pgf_dv_omc_r_up1 =  (pgf_dv_up1/updated_pop)*100000)
View(mil_cv)
mil_cv <- mil_cv %>%
relocate(divipola, year,
bd_st_rg_omc_up1.2, conf_events_omc_r_up1, pgf_ckill_omc_r_up1, pgf_cmass_omc_r_up1, pgf_dv_omc_r_up1)
View(mil_cv)
write_xlsx(mil_cv, "Ortega(2024)-CV-MilitaryVariables_Updated(09282024).xlsx")
rm(check)
check <- read_xlsx("/Volumes/Backup Plus/Storage-OrganizedFiles/Article1-ReplicationMaterials/5.Data/CV/Ortega(2024)-CV_FV-Updated(09282024).xlsx")
all.equal(check, mil_cv)
View(check)
cv <- left_join(cv, mil_cv, by = c("divipola", "year"))
View(cv)
recruit <- read_csv("verdata-reclutamiento-R1.csv")
recruit_reb <- recruit %>%
rename(divipola = muni_code_hecho,
year = yy_hecho) %>%
filter(p_str == "GUE-FARC" | p_str == "GUE-ELN" | p_str == "GUE-OTRO")
dane_ru <- recruit_reb %>%
group_by(divipola, year) %>%
summarise(reb_ru = n())
m_data_f3b <- left_join(rcs_data, dane_ru) # The data on recruitment covers the period from 1990 to 2005. Thus, I replace NA by 0 in this period and filter the data since 1990. Before that period, the data can still have NAs
m_data_f3b <- m_data_f3b %>%
filter(year > 1989)
m_data_f3b <- m_data_f3b %>% replace_na(list(reb_ru = 0))
m_data_f3b <- m_data_f3b %>%
dplyr::select(year, divipola, reb_ru)
cv <- left_join(cv, m_data_f3b)
cv <- cv %>%
mutate(reb_ru2 = case_when(
reb_ru == 0 ~ 0,
reb_ru > 0 ~ 1
))
cv <- cv %>%
mutate(reb_ru_r = (reb_ru/updated_pop) * 100000)
View(cv)
cv <- cv %>%
rename(cv5c.1.bd_o = bd_st_rg_omc_up1.2, # Military Dispute
cv6b.1.ce_o_r = conf_events_omc_r_up1, # Conflict Events // Updated
cv7b.1.pgf_ck_o_r = pgf_ckill_omc_r_up1, # Civilian Assassinations & Massacres by PGF
cv7b.2.pgf_cm_o_r = pgf_cmass_omc_r_up1,
cv7b.3.pgf_cd_o_r = pgf_dv_omc_r_up1)
cv <- cv %>%
relocate(divipola, year,
cv1.lpop, cv2.rur_p, cv3c.c_lsh1, cv4.nbi,
cv5c.1.bd_o, cv6b.1.ce_o_r, cv7b.1.pgf_ck_o_r, cv7b.2.pgf_cm_o_r, cv7b.3.pgf_cd_o_r,
reb_ru, reb_ru2,
median_c_lsh_m, median_c_lsh_c, median_c_lsh_b, median_c_lsh_e)
write_xlsx(cv, "Ortega(2024)-CV_FV-Updated(09282024).xlsx")
rm(check)
check <- read_xlsx("/Volumes/Backup Plus/Storage-OrganizedFiles/Article1-ReplicationMaterials/5.Data/CV/Ortega(2024)-CV_FV-Updated(09282024).xlsx")
check <- check %>%
filter(year > 1984 & year < 2006)
View(cv)
check <- read_xlsx("/Volumes/Backup Plus/Storage-OrganizedFiles/Article1-ReplicationMaterials/5.Data/CV/Ortega(2024)-CV_FV-Updated(09282024).xlsx")
check <- check %>%
relocate(divipola, year,
cv1.lpop, cv2.rur_p, cv3c.c_lsh1, cv4.nbi,
cv5c.1.bd_o, cv6b.1.ce_o_r, cv7b.1.pgf_ck_o_r, cv7b.2.pgf_cm_o_r, cv7b.3.pgf_cd_o_r,
reb_ru, reb_ru2,
median_c_lsh_m, median_c_lsh_c, median_c_lsh_b, median_c_lsh_e)
cv3 <- cv %>%
relocate(divipola, year,
cv1.lpop, cv2.rur_p, cv3c.c_lsh1, cv4.nbi,
cv5c.1.bd_o, cv6b.1.ce_o_r, cv7b.1.pgf_ck_o_r, cv7b.2.pgf_cm_o_r, cv7b.3.pgf_cd_o_r,
reb_ru, reb_ru2,
median_c_lsh_m, median_c_lsh_c, median_c_lsh_b, median_c_lsh_e)
cv3 <- cv %>%
select(divipola, year,
cv1.lpop, cv2.rur_p, cv3c.c_lsh1, cv4.nbi,
cv5c.1.bd_o, cv6b.1.ce_o_r, cv7b.1.pgf_ck_o_r, cv7b.2.pgf_cm_o_r, cv7b.3.pgf_cd_o_r,
reb_ru, reb_ru2,
median_c_lsh_m, median_c_lsh_c, median_c_lsh_b, median_c_lsh_e)
check <- check %>%
select(divipola, year,
cv1.lpop, cv2.rur_p, cv3c.c_lsh1, cv4.nbi,
cv5c.1.bd_o, cv6b.1.ce_o_r, cv7b.1.pgf_ck_o_r, cv7b.2.pgf_cm_o_r, cv7b.3.pgf_cd_o_r,
reb_ru, reb_ru2,
median_c_lsh_m, median_c_lsh_c, median_c_lsh_b, median_c_lsh_e)
all.equal(check, cv3)
